package com.sql;


import com.mysql.jdbc.Driver;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Properties;

public class JDBC {
    public static void main(String[] args) throws SQLException {
        Driver driver = new Driver();

        String url="jdbc:mysql://localhost:3306/db01";

        Properties properties = new Properties();
        properties.setProperty("user" ,"root");
        properties.setProperty("password","508065");

        Connection connect = driver.connect(url, properties);
        String sql="CREATE TABLE student2(\n" +
                " id INT ,\n" +
                " NAME VARCHAR(10),\n" +
                " Chinese DOUBLE,\n" +
                " Math DOUBLE,\n" +
                " English DOUBLE,\n" +
                " Java DOUBLE\n" +
                ") ;  ";
        String sql2="SELECT *FROM users";
        Statement statement = connect.createStatement();
        int rows=statement.executeUpdate(sql);
        statement.close();

    }
}
